package pl.ptemich.pong.model;

import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;

import pl.ptemich.pong.DrawableObject;

public class Paddle implements DrawableObject {

  private FloatPoint position;
  
  private Color color;
  
  public static final float PADDLE_WIDTH = 10f;
  
  public static final float PADDLE_HEIGHT = 100f;
  
  
  
  public Paddle(FloatPoint position, Color color) {
    this.position = position;
    this.color = color;
  }
  
  @Override
  public void draw(Graphics graphics, FloatPoint origin) {
    graphics.setColor(color);
    graphics.fillRect(origin.getPosX() + position.getIntPosX() - PADDLE_WIDTH / 2, 
                      origin.getPosY() + position.getIntPosY() - PADDLE_HEIGHT / 2, 
                      PADDLE_WIDTH, PADDLE_HEIGHT);
  }
  
}
